import React, { Component } from 'react'
import News from './News'
import Messages from './Messages'
import MyNavLink from '../../components/MyNavLink'
import { Switch, Route, Redirect } from 'react-router-dom'
import css from './index.module.css'
export default class Home extends Component {
    render() {
        return (
            <div className={css.home}>
                <div className={css.navigate}>
                    <MyNavLink to="/home/news">news</MyNavLink>
                    <MyNavLink to="/home/messages">message</MyNavLink>
                </div>
                <div className={css.bottom}>
                    <Switch>
                        <Route path="/home/news"  component={News} />
                        <Route path="/home/messages" component={Messages} />
                        <Redirect to="/home/news" />
                    </Switch>
                </div>
            </div>
        )
    }
}
